Robust barcode and reader for rod position determination

ABSTRACT

A barcode reader and processing circuitry are disclosed for identifying a position of a cylinder rod, for example, along a path of movement. The barcode is marked on a surface of the rod and constitutes a series of markings extending along a portion of the length of the rod. The markings represent encoded information based on numbers calculated with a random number generator, and are grouped into subsets, each of which corresponds to a particular rod position. A portion of the rod including a subset of barcode markings is exposed to light emitted from the reader. Light reflected off the barcode is sensed with an array of photosensors provided in the reader. The photosensors generate electrical signals, and using Bayesian probability, a likely subset of markings is determined corresponding to the received electrical signals. Once identified, the markings subset is associated with a location corresponding to the position of the rod. A barcode reader is also described that is relatively easy to assemble and provides uniform illumination of the barcode.

TECHNICAL FIELD

The present disclosure is directed generally to a system and relatedmethod for determining a location of a movable member, and moreparticularly, to determining the linear position of a movable member.

BACKGROUND

Many construction and earthmoving machines use a hydraulic or pneumaticcylinder for moving a work tool such as a bucket of a wheel loader orexcavator. The cylinder includes a rod coupled to the work tool, at oneend, and a chamber at the other. Hydraulic fluid is provided in thechamber to extend the rod along a linear path, typically extendingseveral meters. The fluid can also be removed from the chamber toretract the rod along the same path. Often the rod location or positionalong the linear path must be known so that movement of the work toolcan be controlled.

Barcodes have been marked on cylinder rods in order to locate theposition of the rod. In particular, the rod may be marked with a barcodeincluding non-repeating segments of code, each of which correspond to adifferent location of the rod. In operation, a sensor is provided in thecylinder adjacent the barcode to identify a particular segment, which isthen associated with a corresponding rod location.

In order to locate a rod position with sufficient resolution, arelatively large number of code permutations are often provided over asubstantial length of the rod. Such complex markings, however, typicallyrequire a relatively large amount of processing power to decode.Although processing power may be reduced with a less complex code, suchsimpler codes have a limited number of permutations and thus can only beused to determine rod location over a limited range of distances.Otherwise, the code repeats itself and would yield multiple locationsfor the same code segment.

U.S. Pat. No. 6,556,946 issued to Sewell on Apr. 29, 2003, describes abarcode utilizing a trinary code including a succession of data fields,each of which includes so-called “trits” or characters. Data is encodedby varying the relative amounts of black and white in each character.The barcode described in the Sewell patent facilitates accurate locationmeasurements over a range of rod positions.

In Sewell, the barcode is exposed to either ambient light or light froman optical source. Light reflected off the barcode is detected by asensor. Data present in the sensor output is read and the rod locationis determined based on the data. In order to accurately sense thebarcode described in Sewell, however, signals generated by the sensorshould be relatively free of noise. Various non-idealities in the opticsand electronics for sensing the barcode, however, as well asimperfections in the rod itself (e.g., spurious reflections on the rodsurface and excess hydraulic fluid) can introduce noise into the sensoroutput signal. Often, the amount of noise can be substantial, and therod location difficult to determine. Accordingly a more robust barcode,which is less susceptible to noise, is required to accurately identifyrod positions.

SUMMARY OF THE INVENTION

In one aspect, the present disclosure is directed toward a method forencoding position information on a movable object, which includes asurface and a longitudinal axis. The method includes a step ofdetermining an information carrying capacity of the movable object basedupon a Shannon limit associated with a spatial bandwidth and anobservable portion. In a further step, coded information indicative of aposition of the movable object is generated. In an additional step, aplurality of markings are provided which extend axially on a portion ofthe surface of the rod in accordance with the coded information and thedetermined information carrying capacity. Consistent with a furtheraspect of the disclosure, a method is also provided for encodingposition information on a movable object. The movable object includes asurface and a longitudinal axis. The method includes steps of generatingcoded information indicative of a position of the movable object, andproviding a plurality of markings extending axially on a portion of thesurface of the movable object in accordance with the coded information.The plurality of markings have an associated spectrum. The spectrum hasfirst frequency components and second frequency components, and theproviding step further includes a step of deemphasizing the firstfrequency components relative to the second frequency components.

In accordance with an additional aspect of the disclosure, a locationmonitoring system is provided which includes a movable member, readercircuit and processor circuit. The movable member is movable along apath, and has a surface with a plurality of markings disposed thereon.The reader circuit is configured to expose a part of the surface of themovable member, and generate a sense signal in response to a portion ofthe light emanating from the exposed part of the surface. The exposedpart of the surface includes a subset of the plurality of markings.

The processor circuit is configured to receive the sense signal, anddetermine a plurality of probability values associated with the sensesignal. Each of the plurality of probability values is associated with acorresponding subset of the plurality of markings. The processoridentifies the subset of the plurality of markings included in the partof the surface based upon at least some of the plurality of probabilityvalues, and identifies a position of the movable member along the pathcorresponding to the identified subset of the plurality of markings.

In accordance with a further aspect of the disclosure, a locationmonitoring system is provided which includes a movable member, readercircuit and processor circuit. The movable member is movable along apath, and has a surface, and a plurality of markings disposed thereon.The movable member is locatable at a plurality of positions along thepath. The reader circuit is configured to expose a part of the surfaceof the movable member, and is configured is to generate a sense signalin response to light emanating from the exposed part of the surface ofthe movable member.

The processor circuit is configured to receive the sense signal, anddetermine a plurality of first probability values associated with thesense signal. Each of the plurality of first probability values beingassociated with first locations on the surface, and each of the firstlocations being spaced from one another by a first distance. Theprocessor circuit selects groupings of the plurality of firstprobability values, a sum of which exceeding a first predeterminedthreshold. The processor circuit further being configured to determine aplurality of second probability values, each of which being associatedwith second locations on the surface. Each of the second locations beingspaced from one another by a second distance less than the firstdistance, and each of the second locations lying within regions of thesurface defined by the selected groupings.

In accordance with an additional aspect of the disclosure, an apparatusis provided for reading an image provided on a surface. The apparatuscomprises a photosensor and a lens. The lens is configured to receivelight from the image and direct the light to the photosensor. The lensand photosensor are attached to a carrier. A housing is also providedhaving an external surface and an internal surface. The external surfacehas a first reference portion and the internal surface has a secondreference portion, which is aligned with the first reference portion.The carrier is attached to the second reference portion such that uponthe first reference portion being positioned at a predetermined distanceaway from the image, light is substantially focused onto thephotosensor.

Consistent with a further aspect of the invention, an optical device isprovided including a housing having an opening. A plurality of opticalemitters are provided in the housing which are configured to outputlight through the opening. A circuit is also included to supplysubstantially the same electrical current to each optical emitter. Inaddition, a plurality of photosensors are provided in the housing forreceiving a portion of the light reflected off a surface external to thehousing.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of this specification, illustrate several embodiments of theinvention and together with the description, serve to explain theprinciples of the invention.

FIG. 1 illustrates a block diagram of a system for identifying a rodlocation consistent with an aspect of the present disclosure;

FIG. 2 illustrates a perspective view of a barcode provided on a rod inaccordance with a further aspect of the present disclosure;

FIG. 3 illustrates an exemplary barcode consistent with an additionalaspect of the present disclosure;

FIG. 4A illustrates a flow chart of a method for generating a barcode inaccordance with a further aspect of the present disclosure;

FIGS. 4B-4F illustrate regions of a rod surface discussed in connectionwith FIG. 4A;

FIGS. 5A-5E illustrate results of intermediate steps of an alternativemethod for generating a barcode in accordance with a further aspect ofthe disclosure;

FIGS. 6A-6E illustrate results of intermediate steps of an additionalmethod for generating a barcode consistent with an aspect of thedisclosure;

FIG. 7 is a block diagram illustrating interaction of various noiseparameters affecting the quality of signals in the system shown in FIG.1;

FIG. 8 illustrates a method of determining rod location in accordancewith a further aspect of the disclosure;

FIG. 9 illustrates a perspective view of a cross-section of a readerconsistent with another aspect of the present disclosure;

FIG. 10 illustrates an alternative cross-sectional view of the sensorconsistent with the disclosure;

FIG. 11 is a diagram of the reader highlighting additional features inaccordance with a further aspect of the present disclosure; and

FIG. 12 illustrates a circuit for supplying current to barcodeilluminating optical emitters in accordance with an additional aspect ofthe disclosure.

FIG. 13 illustrates an exemplary plot of a white noise signal;

FIG. 14 illustrates an exemplary plot of noise signal having filtered ordeemphasized high frequency components;

FIG. 15 illustrates a plot of exemplary probability values;

FIG. 16 illustrates an alternative method of determining rod location inaccordance with a further aspect of the disclosure;

FIG. 17 illustrates an exemplary spatial frequency spectrum, which maybe associated with optical components, such as lens 910 shown in FIG. 9;

FIG. 18 illustrates an exemplary spatial frequency spectrum of a barcodein accordance with an aspect of the present disclosure; and

FIG. 19 illustrates an exemplary spatial frequency spectrum of a barcodein accordance with a further aspect of the present disclosure.

DETAILED DESCRIPTION

Reference will now be made in detail to exemplary embodiments of theinvention, examples of which are illustrated in the accompanyingdrawings. Wherever possible, the same reference numbers will be usedthroughout the drawings to refer to the same or like parts.

FIG. 1 illustrates a block diagram of system 100 for monitoring aposition and controlling movement of movable member, object or rod 10.Rod 10 typically includes a conventional thermally sprayed outer surface11 and a longitudinal axis 24. A plurality of markings 12 constituting abarcode are provided on outer surface 11, typically with a highintensity laser that selectively exposes portions of surface 11.Markings 12 represent binary coded information in the sense that themarks by being dark or light represent 0s or 1s (but this should not beconfused with information about the position of the rod which is a morediffuse quantity). Reader circuit 26 includes one or more opticalemitters 14, such as light emitting diodes (LEDs), that expose a portionof the outer surface 11 including a subset of markings to lighttypically at infrared frequencies, although other frequencies of lightmay be used as well. Light is reflected off or emanates from the exposedportion of outer surface 11 and is sensed by sensor 16, typicallyincluding an array of photosensors. Alternatively, markings may beprovided on an internal surface of rod 10, and exposed from within. Inthat case, the rod may be transparent, and photosensors providedexternal to the rod would sense light passing through a portion of theinternal surface of the rod instead of being reflected from it. Themarkings may also be observed from inside such a rod. In addition, rod10 may be exposed with ambient light, if such light is of sufficientintensity.

Collectively, the photosensors (discussed in greater detail below)output a sense signal. Moreover, each photosensor, representing a pixelof a sensed barcode image, may have a viewing length of, for example,63.5 microns, and since 128 such photosensors are typically provided ina linear array, an 8.1 mm section of outer surface 11 is typicallysensed, although other lengths and other view pixel lengths arecontemplated by the present disclosure.

In response to the received light, sensors 16 output electrical signalsto processor circuit 18, which may be a conventional microprocessor,computer, or digital signal processor and associated circuitry.Processor circuit 18, in turn, determines a position of rod 10 andinformation concerning the position is optionally displayed on a userinterface device 22 including, for example, a display or monitor. Inaddition, a keyboard or other data entry device may be provided, and inresponse to commands input to the processor circuit 18 and theidentified position, processor circuit 18 supplies control signals tomechanical control circuit 20, to thereby move or change the location ofrod 10.

Consistent with an aspect of the disclosure, processor 18 executesinstructions for carrying out or performing a method of identifying alocation of rod 10, such as the method described below in connectionwith FIG. 8 or the method discussed below in connection with FIG. 16.Such instructions may be read into a computer readable medium, such asmemory 19 incorporated into or provided external to processor 18. Inalternative embodiments, hard-wired circuitry may be used in place of orin combination with software instructions to implement the invention.Thus, embodiments of the invention are not limited to any specificcombination of hardware circuitry and software.

The term “computer-readable medium” as used herein refers to any mediumor combination of media that participates in providing instructions toprocessor 18 for execution. Such a medium may take many forms, includingbut not limited to, non-volatile media, volatile media, and transmissionmedia. Non-volatile media includes, for example, optical or magneticdisks. Volatile media includes dynamic memory. Transmission mediaincludes coaxial cables, copper wire and fiber optics, and can also takethe form of acoustic or light waves, such as those generated duringradio-wave and infra-red data communications.

Common forms of computer-readable media include, for example, a floppydisk, a flexible disk, hard disk, magnetic tape, or any other magneticmedium, a CD-ROM, any other optical medium, punchcards, papertape, anyother physical medium with patterns of holes, a RAM, a PROM, and EPROM,a FLASH-EPROM, any other memory chip or cartridge, a carrier wave asdescribed hereinafter, or any other medium from which a computer orprocessor 18 can read.

FIG. 2 illustrates rod 10 disposed in a cylinder body 220. Collectively,rod 10 and cylinder body 220 constitute a cylinder 230, which can be anyone of a wide variety of hydraulic, pneumatic and similarly actuatedcylinders. Cylinder 230 is operable to extend rod 10 from, and retractrod 16 into, cylinder body 220 typically along a linear path of movementrepresented by arrow 240. Path 240 typically extends axially withrespect to a longitudinal axis 24. Optionally, reader circuit 26 may beprovided in cylinder body 220.

In the embodiment shown in FIG. 2, rod 10 is movable while cylinder body220 is stationary. The present disclosure, however, is applicable toother rod and cylinder body configurations whereby the rod is stationaryand the cylinder body is movable, as well as configurations in whichboth the rod and cylinder body are movable. As used herein, the term“movable” refers to actual movement of the rod, member or object, aswell as relative movement in configurations in which the rod, member orobject is stationary but the reader circuit is movable, andconfigurations in which both the rod, member or object and the readercircuit are movable.

Markings 12 may include endpoints respectively provided adjacentcorresponding ends of rod 10. For example, marking endpoint 250 isprovided adjacent one end of rod 10, and another marking endpoint islocated within cylinder body 220 adjacent the other end of rod 10,which, in the position shown in FIG. 2, is adjacent reader circuit 26.

Reader 26 will next be described with reference to FIGS. 9-12. FIG. 9illustrates a cross-sectional perspective view of reader 26 including ahousing 902 enclosing at least one optical emitter, e.g., light emittingdiodes, LEDs 906-1 and 906-2 and an array of photosensors 908,including, for example, a linear array of CMOS photosensors. Sensors 908and LEDs 906-1 and 906-2 are disposed on a carrier 904, which in apreferred configuration may include a circuit board upon which aremounted the local electronic components necessary for the operation ofthe sensor. Light emitted by LEDs 906-1 and 906-2 (represented by region917) passes through cylindrical lens 912 and diffuser 914 and outthrough opening 916. Light reflected off a portion of barcode markings12 (also represented by region 917) also passes through opening 916, andis collected by the lens 910 which forms an image of the barcode in theplane of the photosensors 908. In a preferred configuration, the lens910 may include an array of graded index lenses known as a Selfoc LensArray (SLA). The opening 916 may be closed by a planar transparentoptical window 918 to provide protection for the sensor components.Circuitry 901 associated with CMOS sensors 908 receives outputs from thesensors and generates sense signals that are fed to processor 18.Optionally, sensor 908 may include 128 pixels on an 63.5 micron pitch,each pixel being 63.5×55.5 microns in size. Preferably, LEDs 906-1 and906-2, photosensors 908 are formed integrally with carrier 904.

FIG. 10 illustrates a cross-sectional view of reader 26 when provided onrod 10. In particular, a casing 1002 is provided on rod 10 to holdreader 26. Casing 1002 has a predetermined thickness such that when thereader 26 (manufactured in accordance with the procedure describedbelow) is mounted thereon, LEDs 906, photosensor and circuitry 901/908,lenses 910, 912 and diffuser 914 are provided at a desired distance fromsurface 11 of rod 10 to facilitate accurate illumination, focusing andsensing of optical signals reflected off barcode markings 12 without theneed for adjustment.

FIG. 11 shows a diagram of reader 26 in which various components shownin FIGS. 9 and 10 have been omitted for clarity and housing 902 has beenredrawn to highlight a further aspect of the present disclosure. Thefeatures to be described with reference to FIG. 11 facilitate simple andprecise assembly of the optical components contained therein to assurethat barcode markings 12 are adequately exposed, and light reflected offthe barcode is properly focused and sensed.

As further shown in FIG. 11, housing 902 includes an outer surface 1125and inner surface 1119. Outer surface 1125 has a reference portion 1102disposed on a portion 1160 of the casing 1002, a known distance from thescale or markings 12 on surface 11 of the rod 10. The inner surface hasa reference portion 1104. An optical carrier 1130 is positioned bylocating its reference surface 11 05 against the housing internalreference surface 1104. The sensor components: (LEDs) 906-1, 906-2, CMOSsensors 901/908 (where these latter components may themselves be mountedon a sub-carrier circuit board described previously) illumination lens912, diffuser 914, imaging lens 910 are mounted on the optical carrier1130. The following mechanical reference chain relates the position ofthese components to that of the rod and hence the bar code (scale) to bemeasured: 1105 (optical carrier reference surface) to 1104 (sensorhousing internal reference) to 1102 (sensor housing external reference)to 1160 (casing reference) to 12 (rod surface plus scale). This enablesthe sensor component (906-1, 906-2, 912, 914, 910, 901) to be locatedagainst appropriately positioned mechanical references machined oncarrier 1130 such that they are optimally positioned to illuminate thebar code (scale) (using 906-1, 906-2, 912, 914) and to form an image ofthe illuminated scale in the plane at the CMOS detector array (901, 908)using the lenses 910. This enables the sensor to be assembled using asimple process of mechanical component location and installation on thecasing 1002. As a result, markings 12 are optimally illuminated andimaged without the need for either external or internal adjustment.

Moreover, internal reference portion 1104 and external reference portion1102 are aligned along reference line 1106, such that photosensor array908 is provided above line 1106 in the drawing and lens 910 is providedbelow. Housing 902 is typically clamped to casing 1002 so that if thetemperature in housing 902 increases, lens 910 will move in a directionindicated by arrow 1113, while photosensor array 908 will move in anopposite direction indicated by arrow 1111. As a result, at relativelyhigh temperatures, lens 910 will move closer to markings 12, butphotosensor array 908 will move farther away. Although the focal planeassociated with lens 910 will shift in an opposite direction away fromsurface 11, so too will photosensor array 908. Thus, the image projectedby lens 910 remains substantially focused and thermally induced blurringis minimized. In a similar fashion, blurring due to decreases intemperature is compensated by movement of the lens and photosensor arrayin directions opposite to those described above.

Barcode markings 12 constitute a series of variable width light and darkbands, and should preferably be illuminated with light havingsubstantially uniform intensity over the exposure area of surface 11.Otherwise, for example, a light band of barcode markings 12 may beinsufficiently illuminated and erroneously sensed as a dark bank, whilea dark band receiving too much light may be incorrectly sensed as alight band. Thus, neither LED 906-1 nor LED 906-2 should besubstantially brighter (or darker) than the other. In addition, sinceLEDs 906-1 and 906-2 are turned intermittently on for brief periods oftime, during which light reflected off the rod surface is sensed, eachLED should typically turn-off at substantially the same time so thatlight is not further sensed after an illumination period. LEDs 906-1 and906-2 are typically turned on one every 10 ms for a duration of 25microseconds to thereby minimize blurring distortions due to rodmovement.

LEDs 906-1 and 906-2 should preferably receive the same amount ofelectrical current so that each has substantially the same luminosity.The LEDs, however, cannot be simply connected in parallel because slightvariations in external wiring or internal LED variations (a differenceof potentially 10-fold per 60 mV difference in applied voltage minusseries resistance voltage drop) can result in substantial differences incurrent flow and thus brightness.

As shown in FIG. 12, circuit 1200 is provided in accordance with anaspect of the present invention to supply substantially the same currentto both LEDs 906-1 and 906-2. Circuit 1200 may include bipolartransistors 1216 and 1218, both coupled to a common terminal 1210through corresponding resistors 1214 and 1212 through emitters 1226 and1220, respectively. Collectors 1224 and 1222 are respectively coupled toLEDs 906-1 and 906-2, and bases 1228 and 1230 are tied to one another.The cathodes of LEDs 906-1 and 906-1 are connected in common to terminal1238. Terminal 1238 may be at ground potential, or any other suitablepotential that is less than or more negative than the potential ofterminal 1210. The bias across terminals 1210 and 1238 is intermittentlyapplied to pass a current through LEDs 906-1 and 906-2.

Bases 1228 and 1230 may be coupled to a common constant current sourceso that transistors 1216 and 1218 can be rendered conductive or turnedon. However, at relatively high currents, the series resistance of LEDs906-1 and 906-2 can be substantial. In which case, transistors 1216and/or 1218 can “saturate”, whereby LEDs 906-1 and 906-2 cannot sinksufficient collector current, and charge builds-up in bases 1228 and/or1230 of transistor 1216 and 1218, respectively. Once power is cutoff,however, e.g., terminal 1210 is set to a low potential, excess carriersor charges in base regions of transistors 1216 and 1218 flow from thecollector and through LEDs 906-1 and/or 906-2, thereby extendingturn-off time.

As further shown in FIG. 12, however, base 1228 is connected to emitter1224 (though a resistor 1232 to be discussed in greater detail below).As a result, since base 1228 is 0.7 V below emitter 1226 (because theemitter-base junction is always forward biased during operation), thepotential at collector 1224 will similarly be 0.7 V below the emitter.Under such biasing conditions, transistor 1216 will not saturate.

Although base 1230 may also be connected to collector 1222 to reduce thelikelihood that transistor 1218 saturates, collectors 1222 and 1224would be shorted in this instance, and provide a path through whichcurrent may be diverted from one LED to the other. Such currentdiversion and imbalance can take place when the series resistance, forexample, of one device differs from the other, resulting in greatercurrent flowing through the device having the least resistance.

To assure more balanced current flow, a Schottky diode 1232 may beconnected across base 1230 and collector 1222, as shown. Since thecathode of diode 1232 is coupled to collector 1224, current flow fromcollector 1224 to collector 1222 is effectively blocked, and current issupplied, undiverted, to LED 906-1. Moreover, the voltage dropassociated with diode 1232 is about 300 mV. Thus, the potential atcollector 1222 is −0.7 V (the base to emitter potential difference) less−0.3 V (the voltage drop associated with diode 1232), or −0.4 V (allrelative to emitter 1220), which biases transistor 1218 out ofsaturation, as well.

However, if a potential difference greater than or equal to 0.3 V isapplied across the anode and cathode of diode 1232, diode 1232 willtypically conduct. Accordingly, variations in series resistance in LEDs906-1 and 906-2 can render diode 1232 conductive so that current flowmay be diverted from collector 1222 through diode 1232, and through LED906-1, even though diode 1232 can block current diversion from collector1224 to collector 1222.

Although diverted current through LED 906-1 may be difficult toeliminate entirely, such current can be reduced by connecting resistor1291 between the collector 1224 and the common connection between bases1228 and 1230 and the cathode of diode 1232. Resistor 1291 may have aresistance of 20 ohms, which is typically sufficient to increase theresistance of diverted current path through LED 906-1 so that mostcurrent flowing from collector 1222 flows undiverted through LED 906-2.

Thus, circuit 1200 provides substantially balanced current flow betweenLEDs 906-1 and 906-2 because of the equality of the emitter resistors1212 and 1214 and the exponential control of collector current bybase-emitter voltage via the Ebers-Moll equation, and also facilitatesuniform turn-off for both LEDs to realize accurate sensing of thebarcode markings.

Returning to FIGS. 9 and 10, photosensor array 908 is typically suppliedwith a clock signal to sequentially read each pixel of the array. Theoutputs from photosensor array 908 are fed to processor circuit 18 fordetermining rod location, as further discussed below.

Turning to FIG. 3, a portion of barcode markings 12 is shown in greaterdetail. Barcode 12 includes a plurality of markings 350, which in thisexample include bands of various widths. The markings are grouped intomarking subsets, three of which are shown as subsets 310, 311 and 312.Each marking subset corresponds to a particular rod location. In thiscase, subsets 310-312 correspond to rod locations 400 microns apart. Amemory 19 in processor circuit 18 stores each barcode marking subset andcorresponding rod position or location such that upon identifying aparticular marking subset, the corresponding rod location can be readilyidentified.

A capacity of the encoded information in barcode 12 is based upon aShannon limit associated with the code information. As generallyunderstood, Shannon's theorem defines an amount of information that canbe carried through a channel given a particular amount of noise presentin the channel. The Shannon limit capacity C, in the formula below, istypically measured in bits per second, but in the context of the barcodeof the present disclosure, C is indicative of bits per unit length ofrod. For each channel with noise and non-infinite bandwidth, C isgreater than or equal to the amount of information that can becommunicated down the channel without errors. Moreover there is nosmaller value than C with this property.

Generally, signals can be represented by a wave, e.g. a square wave,which is a superposition of multiple sinusoids, each having a particularwavelength and frequency. The collection of frequencies constitutes abandwidth or spectrum. Here, if the channel carries a range of suchfrequencies and has an associated bandwidth W Hz (including bothpositive and negative frequencies) (meaning that it has unity gain forfrequencies inside ±W and zero gain outside that range), and the channelis real rather than complex, then the channel capacity is given by$C = {W\quad{\log_{2}\left( {1 + \frac{S}{N}} \right)}}$

where N is the noise power, and S the signal power. This version of thetheorem assumes that the noise is white and Gaussian (i.e., the noise isGaussian in that it is random but Gaussianly distributed about some meanvalue, and white in that noise associated with any one photosensor, forexample, is not correlated to another photosensor and the distributionor variance in noise values for each photosensor is the same) and thatboth noise and signal are real.

If the signal to noise ratio is not constant across the bandwidth, thetheorem is modified to read (hereinafter “Equation A”)$C = {\int_{- W}^{W}{{\log_{2\quad}\left( {1 + \frac{S(f)}{N(f)}} \right)}\quad{\mathbb{d}f}}}$

for a real channel.

Accordingly, the number of bits of information per meter of rod that canbe sent through the channel with error probability approaching zero ascode length increases to infinity cannot be greater than the capacity.

In the barcode consistent with the present disclosure, thesignal-to-noise ratio is not-constant across the bandwidth. Moreover,the code length cannot be infinite; the reader typically senses portionsof the rod only a few mm in length. In addition, the information encodedin the barcode is binary and thus constitutes a series of 1s and 0s,rather than arbitrary values in between. As noted above, in the exampledisclosed herein, the width of each rod pixel is 50 μm and a view widthor an observable portion of surface 11 of the reader is about 8 mm whichyields 160 transmitted bits per view, which is believed to besufficiently long enough for Shannon's limit to apply.

In the exemplary embodiment described herein, the overall bandwidth (inthis instance, the number of bits per mm) is 11.7 bits per mm, or about93 bits total. Based on the above formulas and with a noise levelcorresponding to a received optical signal to noise ratio of −6 dB, thesignal power is ¼ of the noise power, so that an information carryingcapacity of approximately 30 bits can be expected, minus a reduction fornon-idealities not accounted for by the theoretical assumptions ofShannon's theorem. The sensed information is expected to be sufficientto resolve the rod's location to within roughly one millionth of thelength of the rod (excluding the effect of the reduction)—to about 5μm—which was measured, but at a signal-to-noise ratio of 4.7 dB becauseof the reduction.

The disclosed methodology herein departs from the theoreticalassumptions of Shannon's theorem in the following manner. The barcodepattern transmitted for a given position x is not independent of thepattern transmitted for position x+δ if δ<0.007 m. Accordingly,assumptions concerning white noise may not hold for such positions.Moreover, the noise is of unknown amplitude, as is the signal, so theparameters S/N in the above formulas are difficult to determineprecisely. Further, Shannon's theorem requires long lengths of code inorder to achieve the calculated capacity.

Moreover, as noted above, the basic form of Shannon's theorem assumesthat the noise distribution for each frequency component in a channel isthe same, or that the noise is “white.” Although surface noise of rod10, due to surface imperfections, is nearly white, light reflected offrod 10 is blurred by lenses 910, and the surface noise is thusspectrally shaped in a further departure from the assumptions ofShannon's theorem discussed above. In order to improve channel capacity,however, the spectrum associated with the barcode is correspondinglyshaped to include spatial frequencies in proportion to the extent towhich they are not blocked by lens 910, to thereby substantially conformto the spectrum of lens 910.

In more detail, white noise has a spectrum in which each frequencycomponent has the same noise distribution. As seen in FIG. 13, the value(y axis) at each time (x axis in FIG. 13) of noise signal 1300 can havea value that varies independently of values at other times. As seen inFIG. 14, however, if higher frequency components are filtered out, forexample through blurring, a “pink” noise signal 1400, as shown in FIG.14, can be obtained (FIG. 14 is shown for illustrative purposes and doesnot represent a particular filtering of the spectrum shown in FIG. 13).Spectrum 1400 possesses a degree of continuity from one time to thenext, and therefore exhibits more gradual peaks 1410 and valleys 1420,then the noise signal shown in FIG. 13.

Information (e.g., markings) having spatial spectral components filteredout by the channel many not be accurately sensed or detected, therebydecreasing the capacity of a channel encoded with high-frequencycomponents. Information may be encoded more efficiently, however, if thespectrum associated with the information more closely matches thefiltered spectrum. In the present example, the spectrum associated withbarcode 12 is shaped to correspond to the blurred surface noise spectrumof rod 10, to thereby increase information capacity of the barcode.

In particular, an exemplary spectrum 1700 which may be associated withlens 910 is shown in FIG. 17. Spectrum 1700 is shown for illustrativepurposes, and typically depends upon the structure and composition oflens 910. As noted above, the shape of spectrum 1700 is attributable toblurring caused by lens 910. Spectrum 1800 shown in FIG. 18 represents aspatial frequency spectrum associated with a barcode consistent with anaspect of the present disclosure, but does not fully match the spectrum1700, and may result in less efficient reading of the barcode. FIG. 19,however, illustrates an alternative barcode spectrum consistent with afurther aspect of the present disclosure, whereby high or firstfrequency components (e.g., frequency components at 1×10⁴ cycles permeter) have been filtered or deemphasized relative to lower or secondfrequency components (e.g., frequency components less than 5×10³ cyclesper meter) to more closely match or substantially conform to the shapeof spectrum 1700. As a result, more efficient sensing of barcodeinformation can be achieved.

In order to provide a barcode having an associated spectrum that isappropriately shaped, and consistent with a feature of the presentdisclosure, a random number generator calculates series' ofpseudo-random numbers, each term of each series corresponding to a shortcontiguous region of surface 11 of rod 10. Each series is preferablyweighted by a given factor, which can be determined empirically. Thus,one series of numbers corresponding to relatively large and widelyspaced regions on the surface may be weighted more heavily than anotherseries of number corresponding to smaller and more closely spacedregions. Thus, when the series' are summed to obtain the barcode(whereby, for example, a positive sum value designates a light region onsurface 11, while a negative sum designates a dark region) certainspatial frequency components may be emphasized while others aredeemphasized to obtain a spectrum having a preferred shape.

If different optics are used, the above-described blurring and thusspectrum-shape, may change. Thus, optimal performance may be obtained ifweighting factors, the number of series summed, and the surface spacingassociated with each term of each series, are tailored for given lensesand optics in the optical reader.

An exemplary method for generating barcode 12 will next be described inconnection with FIGS. 4A-4F. FIG. 4A is a flowchart illustrating stepswhich can be performed to generate a barcode consistent with an aspectof the disclosure, and FIGS. 4B-4F illustrate regions on rod surface 11discussed in connection with FIG. 4A.

As noted above, the barcode constitutes a series of bands of variouswidths on surface 11, typically marked with a laser. The bands arecreated by first generating a first weighted sequence of numbers (step402). The numbers are preferably calculated with a Gaussian randomnumber generator (although other random number generators may be used)and each is multiplied by a weight factor (1 in this example). Each termor number of the series of random numbers is associated with firstregions 430 of surface 11 of rod 10 (see regions in FIG. 4B). In thisexample, each region has a first width of 50 microns, for example. Instep 404, a second weighted sequence is obtained by multiplying a seriesof numbers calculated with a Gaussian random number generator, andmultiplying the series with a second weight factor, e.g., 8 √{squareroot over (2)}. Each weighted number is associated with second regions432 in surface 11, as shown in FIG. 4C. In the present example, eachsecond region 432 has a second width of 100 microns, for example, andoverlaps each of first regions 430.

Third, fourth and fifth weighted number sequences can also be generatedin a similar fashion in steps 406, 408 and 410, respectively. Namely,each number of the sequence is a product of a weight factor and aGaussian random number generated term. The third, fourth and fifthweight factors are ${8\sqrt{2}},\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}},$respectively in this example. Each term of the third sequence, however,is associated with 100 micron regions or intervals 434 shifted by 50microns relative to the second regions (see FIG. 4D). In addition, eachterm of the fourth sequence is associated with regions 436 on surface 11having a width of 200 microns (FIG. 4E), and each number of the fifthsequence is associated with 200 micron wide regions 438 shifted 100microns relative to fourth regions 436.

In step 412, the first through fifth sequences are added to one anotherto obtain a summed sequence, each term of which typically has either apositive or negative value and is associated with a particular 50 micronwide region, for example, of surface 11. The positive terms are assigneda value of +1 (step 414), and the negative terms are assigned a value of0 (416). In step 418, the series of 1s and 0s associated with the summedsequence is used to drive a conventional laser for selectively marking(in steps 420 and 422) the 50 micron wide regions of outer surface 11 ofrod 10 to thereby generate coded information. In accordance with suchcoded information, markings may be marked, preferably with a laser, onsurface 11, by scanning or moving rod 10 (step 420) past a laser whichis selectively turned on in response to “0”s (step 422) to create“black” 50 micron wide regions in surface 11, and off in response to“1”s to create “light” 50 micron wide regions (step 424) or markings.

FIGS. 5A to 5E illustrate an alternative method for generating a barcodein accordance with a further aspect of the present disclosure. Themethod shown in FIGS. 5A-5E is similar to that discussed above in regardto FIGS. 4A to 4F, except the terms of each randomly generated numberseries are not multiplied by a weighting factor. In addition, only threeseries are added, instead of five as discussed above. In addition, inFIG. 5A each term of a series is calculated by a Gaussian random numbergenerator and assigned a corresponding 50 micron wide region of surface11. Each square 510 in FIG. 5A (as well as FIGS. 5B, 5C and 6A-6C) in ahorizontal direction corresponds to a 50 micron region on rod surface11. In a vertical direction, the magnitude of each number or term isrepresented by a corresponding number of shaded squares. In FIG. 5B, asecond series of randomly generated numbers (calculated with a Gaussianrandom number generator) are assigned corresponding 100 micron wideregions in surface 11, the magnitude of each number of the second seriesbeing represented by a corresponding number of shaded squares in thevertical direction. In addition, in FIG. 5C, each term of a thirdsequence of numbers, generated with a Gaussian random number generatoris associated with corresponding 200 micron wide regions on surface 11.The sequences are then added, the sum of which is depicted by the barchart 520 in FIG. 5D. Positive terms of the summed series are thenassigned a +1 value or “light”, and negative terms are assigned a 0value or “black”. The resulting series of 1s and 0s is used to turn alaser on and off to selectively mark surface 11 over 50 micron regionscorresponding to each term of the binary sequence. Accordingly, aportion of barcode 530 shown in 5E is marked on surface 11 of rod 10.

FIGS. 6A to 6C illustrate the first through third series of randomlygenerated numbers shown in FIGS. 5A to 5C, but multiplied by first,second and third weighting factors, respectively. In this example, thefirst, second and third weighting factors equal 1, 4 and 1,respectively. The first through third weighted series are added in FIG.6D to obtain bar chart 620, and the resulting barcode 630 is shown inFIG. 6E based on assignment of 1s and 0s in a manner similar to thatdescribed above.

As noted above, markings 350 are divided into subsets, and eachcorresponds to a different position of rod 10. To ascertain a positionof rod 10, a portion of surface 11 is exposed to light and a sensesignal is generated in response to light reflected off that portion ofsurface 11. A likely subset of markings corresponding to the sensesignal is then identified and associated with a location of rod 10.

In determining the likely subset of markings corresponding to the rodlocation, it is noted that the sense signal often does not preciselycorrespond to the markings in the exposed portion of surface 11. Severalsources of noise distort the light supplied to the barcode, as well aslight reflected from the bar code, thereby affecting the sensed signaloutput from photosensors in sensor 16. In addition, electronic noise,noted above, originating in circuitry associated with the photosensorscan further distort the sense signal. A more detailed discussion ofnoise sources will next be presented.

Scale or markings 12 on surface 11 ideally constitute a square wave, butin practice are observed as a spatially filtered square wave due to theblurring distortion caused by the optics 910 and rod movement, asdiscussed above. However, the signal thus obtained is neither theoriginal ideal square wave nor the blurred and filtered form of it.Rather, the sense signal is corrupted by electronic noise and surfacenoise.

Electronic noise is associated with the photosensors in sensor 16 andassociated circuitry. Various forms of electronic noise are known,including, among other sources of electronic noise, photon or shotnoise, Johnson noise, and kT/C noise (the equivalent of Johnson noisefor discharging capacitors). The noise sources are associated with theelectronics, which is necessarily independent of any noise sourceassociated with the light itself that is received by sensor 16.Accordingly, if rod 10 remains stationary and a sequence of images(i.e., images of a group of markings 12 on surface 11) are collected bysensor 16, the electronic noise associated with each image isessentially independent from image to image—and in particular differentfrom image to image.

Noise associated with surface 11 or surface noise, however, isattributable to many small or microscopic imperfections on surface 11 ofrod 10. Rod 10 is typically made of metal, often chrome or metal, andsurface 11 may include a known thermally sprayed coating. Surface 11,includes a large number of tiny facets, which generate variations in theamount of illumination light reflected into the sensor circuit 16. Ifrod 10 does not move and a sequence of images are collected, each imagewill be of the same portion of surface 11, and thus the sameimperfections will create the same amount of surface noise in eachimage. Accordingly, if multiple images are acquired, averaging suchimages may reduce electronic noise, but not surface noise, nor thedesired signal, i.e., the reflected light representing the illuminatedgroup of markings 12. Relatively tall and thin pixels can be used toaverage surface noise. Alternatively, θ (the angle over which thebarcode extends on surface 11, so as to average the surface noise over arange of the rod's circumference) can be changed. Both approaches,however, may be difficult to implement.

Experimentally, electronic noise has been found to be 20 dB smaller thanthe signal—but the surface noise may be larger than even the sensesignal in some circumstances. Accordingly, surface noise dominates SNRsubstantially more than electrical noise. A number of factors caninfluence the magnitude of the surface noise including surface finish,or how smooth and shiny surface 11 is. However, the precise geometry ofthe illumination and observation optics 910, 912 and 914 is alsoimportant, as the ratio of sensed signal to noise can be reduced if, forexample, lenses 912 and 914 are spaced a substantial distance away fromsurface 11 e.g., 8 mm as opposed to 1 mm.

Other sources of noise are also present. Namely, lens 910 containsimperfections and thus causes some degree of blurring. Such blurringcombined with the blurring caused by the motion of rod 10 acts as aspatial filter that modifies both received optical signals and surfacenoise. Since photosensor array 908 has sharp cutoffs at both ends,blurring can be represented mathematically by a linear filter matrix A,and each photosensor input can be treated as a component of a vector ofoptical signal values. Matrix A is not square, and therefore is also notinvertible and will be discussed in greater detail below.

FIG. 7 illustrates how various signals and noise sources present insystem 100 interact with one another. As noted above, the barcode orscale includes a plurality of markings 12, each subset of whichcorresponds to a unique position. Thus, the ideal image x 706 is basedon the particular position 704 of rod 10 defining one subset of markingsof the overall scale 702. In the present example, x is a vector ofapproximately one hundred sixty 50 micron wide pixels on the surface 11of rod 10 in front of sensor 16. The ideal image is subject to gainstemming from the laser marking process, as well as from illuminationfrom emitters 14. Collectively, these two gains can be represented by asingle gain parameter t that magnifies the optical signal (see boxes 708and 710). Surface noise n_(rod) is the vector of surface noise values(see box 714), which is assumed to have a Gaussian distribution withzero mean and covariance matrix V before the application of noise gain a(box 718) through illumination (box 716). Amplified surface noise andsignal contribute to the rod signal image tx+σn_(rod) where a is thegain applied to the surface noise; let $s = \frac{1}{\sigma^{2}}$the formulas presented below.

As noted below, movement of rod 10 or velocity (box 722) can introduceblurring (box 720), which in combination with blurring associated withthe optics (box 724), yields a total blurring represented by matrix A(box 726). A is the matrix that represents the total blurring (whichwill be different at different rod velocities); thus in the absence ofnoise yields y=Atx. In addition, observed signal y is a vector of signalpixel values (here, 86 μm pixels wide), typically having a vector length(i.e. dimensionality) which is different from that of x.

Blurring distortion influences the optical signal reflected off markings12 to produce a viewed signal (box 728), which is converted to anelectrical sense or observed signal y (box 732), which is influenced byelectronic noise n_(electronic) (assumed to be Gaussian distributed withzero mean and associated covariance matrix U). As further discussedabove, electronic noise influences the observed signal y (box 730).

Thus, based on sensor circuit 16 output or sensed signal y, acorresponding value of x is determined. As noted above, however, due tovarious noise sources, signal y may not correspond precisely to x, butis some corrupted version of it. As discussed in greater detail below, aprobabilistic approach based on Bayesian inference was adopted todetermine a likely x corresponding to the sensed signal y (in a mannerrelated to that which a probability is calculated that a number shown bya tossed dice, is divisible by 2, given that the number is alsodivisible by 3). In mathematical terms, the Bayesian inference isimplemented to define a posterior distribution of x given y, which issubstantially equivalent to the expression P(w|z) (as discussed ingreater detail below w relates to x, and y relates to z). Since each xcorresponds to a particular rod location, the rod location can be foundonce x is identified.

Accordingly, the present disclosure overcomes conventional barcodeposition techniques, whereby a precise match between a sense signal anda barcode segment is required to determine a rod position. In suchtechniques, various sources of noise (e.g., blurring due to rodmovement, hydraulic fluid, rod imperfections, etc.) distort the sensesignal rendering a match difficult. As disclosed herein, probability,preferably Bayesian probability, is used to determine a likely rodlocation corresponding to a sensed signal. As a result, the barcodeachieved herein is substantially more robust than conventional barcodes.

Functionally, the following steps described below and shown in FIG. 8are carried out to determine rod location based on a sensed signal y.The method consistent with the present disclosure will also be describedwith reference to FIG. 15. In a first step 802, a portion of rod 10 isexposed to light and a sense signal y is generated in response thereto(step 804). A plurality of probability values P(w|z) or posteriordistribution of w given z is calculated (step 808) by processor 18. Asdiscussed in greater detail below, based on at least some of theseprobability values, a subset of markings 12 is identified and associatedwith a corresponding rod location.

As used herein, the term “probability values” includes multiples ofprobability values that may or may not exceed 1, as well as values whichare substantially equal to such multiples.

Graphically, exemplary probability values are shown in FIG. 15 in whicha plurality of probability values 1510, 1520, 1530, 1540, 1550, 1560,1570 and 1580 correspond to particular subsets of markings 12. Themagnitude of each probability value is also shown in FIG. 15, e.g.,probability value 1510 has a value of 0.001, while that of probabilityvalue 1560 is 0.08 (note that to simplify FIG. 15, the height of eachline shown in the drawing is not drawn to scale, but generally reflectsthe relative magnitude of each value). In step 810, a determination ismade as to whether any probability value P(w|z) or sum of any contiguousor consecutive set of probability values associated with locationsspaced over a suitably small physical distance (or over a range ofpermissible error) exceeds a predetermined probability threshold. Thedetermination can be made by comparing the sum or probability value withthe predetermined probability threshold. In the example shown in FIG.15, the predetermined probability threshold is 0.99 and the range ofpermissible error is assumed to ±50 microns equal to the rod pixelwidth. The rod pixel width is the highest common factor of the set ofdistances between each bar edge and the first bar edge on the scale(alternatively, the rod pixel width may be taken to be a sub-multiple ofthe highest common factor, if finer resolution is required; in thepreferred embodiment of the present disclosure resolution of 1-2 micronscan be achieved).

Processor 18, in this instance, will sum triplets (each of which being asubset of the plurality of probability values) of consecutiveprobability values until a sum is obtained that exceeds thepredetermined probability threshold. For example, the sum of values1510, 1520 and 1530 may first be determined to be 0.003, well below thepredetermined threshold value of 0.99. An adjacent triplet of values,1520, 1530 and 1540 may then be added to obtain a sum of 0.013, alsobelow the predetermined threshold. The probability values will continueto be added in threes until a sum is obtained that exceeds thepredetermined threshold value. Here, the sum of the set of values 1540,1550 and 1560 is 0.991, which exceeds the predetermined threshold valueof 0.99. No other triplet of values yields this result. Accordingly,middle value 1550 within the set will be identified, as well as thelocation of the rod associated with the marking subset corresponding tovalue 1550 Also, the rod location within the set will be reported byprocessor 18 to be within a range of permissible error of ±50 microns.

In the example discussed herein, the desired range of permissible errorwas set to be ±50 microns. However, any suitable range of permissibleerror can be selected, but with a corresponding change in the number ofconsecutive probability values to be summed. For example, if the rangeof permissible error was instead set to ±100 microns, then consecutiveprobability values would be added in groups of five until a sum isobtained that exceeds the predetermined threshold. The reportedprobability value is the one located in the middle of the set of fivevalues that yield the qualifying sum, which, in the example shown inFIG. 15, is value 1550.

Returning to FIG. 8, in step 812, marking subsets corresponding tovalues 1540, 1550, and 1560 (again assuming a range of permissible errorof ±50 microns) are identified (step 812), and the identified markingsubsets are associated with rod locations (step 814) by processor 18,typically with a look up table 19 (see FIG. 1). Thus the rod locationwill be identified as the location that is in the middle of the tripletset, or the marking subset corresponding to probability value 1550.Although a single probability value may be found that exceeds thepredetermined probability threshold in step 810, processor 18 typicallysums triplets of consecutive probability values, as discussed above, andreports the middle value of the triplet. Thus, there may be an instancein which the following consecutive probability values are obtained, inorder, 0.8, 0.01 and 0.1, the sum of which being 0.991. Assuming theabove probability threshold of 0.99, the middle value of the triplet,namely 0.01 will be reported, even though its value is less than theother two. Once the middle probability value of the triplet is obtained,the marking subset associated with that probability value is identified,as well as a corresponding rod location. The rod is exposed again (step802) and remaining steps 804, 808, 810, 812 and 814 are repeated toascertain a new rod location.

If no sum of adjacent probability values exceeds the predeterminedthreshold, a “bad” result is obtained and no rod locations are reported.The rod is then exposed again (step 802). Alternatively, in the eventthat a sum of more than two probability values exceeds the predeterminedprobability threshold, a wider range of probable rod locations may bereported. For example, as noted above, if the sum of five adjacentprobability values exceeds the predetermined probability threshold,processor 18 may report a rod location within a 200 microns range (±100microns) of possible rod locations.

Mathematical derivation of the distribution P(w|z) based on a Bayesianinference will next be described. In order to apply Bayesian inference,assumptions for gain variable s and t should be made (i.e., the “priors”on s and t should be set). Simply assuming fixed values of s and t maynot yield an accurate distribution P(w|z), as the actual values of s andt can vary from rod to rod and are subject to various noise influences,as noted above.

s is related to surface noise σ(s=1/σ²) and represents a quantity thatis necessarily positive and whose value is unknown, and preferably large(i.e. σ is preferably small). The value of s can potentially vary overseveral orders of magnitude, and there is no particular reason to favorone decade over another, and logs is assumed to be uniformly distributedover some suitably large range centered on zero (here “suitably large”means so large that making it larger won't make any practical differenceto the results). If logs is uniformly distributed over a large range,then so is log σ (albeit over a different large range). Optical signalgain t, however, behaves differently than s. Preferably t should be aslarge as possible so that the received optical signal has a largemagnitude. Accordingly, t is not expected to be near zero. On the otherhand, the optical signal could have a relatively small magnitude undersome circumstances. Accordingly, the “prior” on t is set to be uniformover some suitably large range starting at zero (i.e. excluding negativevalues). Keeping t uniform is a good approximation and simplifies thederivation of P(w|z). In addition, to further'simplify the derivation,the surface noise gain σ is applied to the electronic noise as well,rather than using two separate gain variables, one for each noisesource. This is a reasonable approximation so long as values of V and Uare chosen such that, as σ varies, the proportion of electronic noiseremains relatively small compared with the surface noise.

Given the above, P(w|z) can be derived in accordance with Bayesianinference. As seen in FIG. 7, and discussed above, y can be expressed asfollows:y=A(tx+σn _(rod))+σn _(electronic)

The covariance matrix of Aσn_(rod)+σn_(electronic) is (AVA′+U)/s (sincesurface and electronic noise are independent), which is positivedefinite and symmetric since both U and V have these features (thesuperscript dash means transpose). Accordingly, AVA′+U has an inversewhich has a positive definite and symmetric square root, so matrix B canbe defined as: ${B\left( {{AVA}^{\prime} + U} \right)}^{- \frac{1}{2}}$

Let z=By and w=BAx. Since B is invertible and known, knowing z carriesexactly the same amount of information about x as knowing y does.Bayesian inference can thus be applied to z, on the basis of a list ofvalues of w, and the results be expected to be exactly the same as ifthe inference had been applied to x.

Accordingly, $\begin{matrix}{z = {By}} \\{= {B\left( {{A\left( {{tx} + {\sigma\quad n_{rod}}} \right)} + {\sigma\quad n_{electronic}}} \right)}} \\{= {{tw} + {\sigma\quad n}}}\end{matrix}$

where n=B(An_(rod)+n_(electronic)). But by virtue of the construction ofB, n has covariance matrix equal to the identity (since surface andelectronic noise are independent). Thus,${P\left( {\left. z \middle| w \right.,t,s} \right)} = {{s^{N/2}\left( {2\pi} \right)}^{{- N}/2}{\mathbb{e}}^{{- \frac{1}{2}}{({z - {tw}})}^{\prime}{s{({z - {tw}})}}}}$

where N is the dimensionality of z, i.e. the number of photodiodes orpixels in sensor circuit 16. P(t) is constant and P(s) is proportionalto 1/s. Therefore, applying the following known laws of probability:$\begin{matrix}{{P\left( w \middle| z \right)} = {\int_{0}^{\quad\infty}{\int_{0}^{\infty}{{P\left( {w,t,\left. s \middle| z \right.} \right)}\quad{\mathbb{d}s}\quad{\mathbb{d}t}\quad\left( {{marginalisation}\quad{rule}} \right)}}}} \\{= {\int_{0}^{\infty}{\int_{0}^{\infty}{\frac{{P\left( {w,t,s} \right)}{P\left( {\left. z \middle| w \right.,t,s} \right)}}{P(z)}\quad{\mathbb{d}s}\quad{\mathbb{d}t}\quad\left( {{Bayes}^{\prime}\quad{theorem}} \right)}}}} \\{= {\int_{0}^{\infty}{\int_{0}^{\infty}{\frac{{P(w)}{P\left( t \middle| w \right)}{P\left( {\left. s \middle| t \right.,w} \right)}{P\left( {\left. z \middle| w \right.,t,s} \right)}}{P(z)}\quad{\mathbb{d}s}\quad{\mathbb{d}t}}}}} \\{\left( {{Chain}\quad{rule}} \right)} \\{= {\int_{0}^{\infty}{\int_{0}^{\infty}{\frac{{P(w)}{P(t)}{P(s)}{P\left( {\left. z \middle| w \right.,t,s} \right)}}{P(z)}\quad{\mathbb{d}s}\quad{\mathbb{d}t}}}}}\end{matrix}$

where the last line follows since knowing the position of the rod makesno difference to the distribution of t, and knowledge of both t and wmakes no difference to the distribution of s.

Now, P(z) does not vary with w (although P(z|w) does). Therefore, theabove formula may be expressed as a proportionality instead of anequality, and by substitution of the above expression, the following isobtained: $\begin{matrix}{{P\left( w \middle| z \right)} = {{\int_{0}^{\infty}{\int_{0}^{\infty}{\frac{P(w)\quad P(t)\quad P(s)\quad P\left( {\left. z\quad \middle| \quad w \right.,\quad t,\quad s} \right)}{P(z)}\quad{\mathbb{d}s}\quad{\mathbb{d}t}}}} \propto}} \\{{\int_{0}^{\infty}{\int_{0}^{\infty}{{P(w)}{P(t)}{P(s)}{P\left( {\left. z \middle| w \right.,t,s} \right)}\quad{\mathbb{d}s}\quad{\mathbb{d}t}}}} \propto} \\{{P(w){\int_{0}^{\infty}{\int_{0}^{\infty}{s^{- 1}{P\left( {\left. z \middle| w \right.,t,s} \right)}\quad{\mathbb{d}s}\quad{\mathbb{d}t}}}}} \propto} \\{{P(w)}{\int_{0}^{\infty}{\int_{0}^{\infty}{s^{{N/2} - 1}{\mathbb{e}}^{{- \frac{1}{2}}{({z - {tw}})}^{\prime}{s{({z - {tw}})}}}\quad{\mathbb{d}s}\quad{\mathbb{d}t}}}}} \\{= {{{P(w)}{\int_{0}^{\infty}{\frac{{\Gamma\left( {N/2} \right)}2^{N/2}}{\left( {\left( {z - {tw}} \right)^{\prime}\left( {z - {tw}} \right)} \right)^{N/2}}\quad{\mathbb{d}t}}}} \propto}} \\{{P(w)}{\int_{0}^{\infty}{\frac{1}{\left( {\left( {z - {tw}} \right)^{\prime}\left( {z - {tw}} \right)} \right)^{N/2}}\quad{\mathbb{d}t}}}}\end{matrix}$

where the proportionality symbol indicates that there is a constant ofproportionality that does not vary with w.

Simplifying, $\begin{matrix}{\begin{matrix}{{P\left( w \middle| z \right)} \propto {P(w)}} \\{\int_{0}^{\infty}{\frac{1}{\left( {\left( {z - {tw}} \right)^{\prime}\left( {z - {tw}} \right)} \right)^{N - 2}}\quad{\mathbb{d}t}}}\end{matrix} = {{P(w)}{\int_{0}^{\infty}{\frac{1}{\left( {{z^{\prime}z} - {2{tw}^{\prime}z} + {t^{2}w^{\prime}w}} \right)^{N/2}}\quad{\mathbb{d}t}}}}} \\{= {{P(w)}{\int_{0}^{\infty}{\frac{1}{\left( {c - {2{tb}} + {t^{2}a}} \right)^{N/2}}\quad{\mathbb{d}t}}}}}\end{matrix}$

where a=w′w,b=w′z,c=z′z, and where a and b depend on w. Now, let φ bethe angle between the vectors w and z, and let r be defined by$r^{2} = {{\cos^{2}\phi} = \frac{b^{2}}{ac}}$so that 0≦r²≦1. Substituting $q = {t - \frac{b}{a}}$in the integral yields:${P\left( w \middle| z \right)} \propto {{P(w)}{\int_{0}^{\infty}{\frac{1}{\left( {c - {2{tb}} + {t^{2}a}} \right)^{N/2}}\quad{\mathbb{d}t}}}}$$\begin{matrix}{= {{P(w)}a^{{- N}/2}{\int_{0}^{\infty}{\frac{1}{\left( {t^{2} - {2t\quad\frac{b}{a}} + \frac{c}{a}} \right)^{N/2}}\quad{\mathbb{d}t}}}}} \\{= {{P(w)}a^{{- N}/2}{\int_{0}^{\infty}{\frac{1}{\left( {\left( {t - \frac{b}{a}} \right)^{2} - \left( \frac{b}{a} \right)^{2} + \frac{c}{a}} \right)^{N/2}}\quad{\mathbb{d}t}}}}} \\{= {{P(w)}a^{{- N}/2}{\int_{- \frac{b}{a}}^{\infty}{\frac{1}{\left( {q^{2} + u^{2}} \right)^{N/2}}\quad{\mathbb{d}q}}}}}\end{matrix}$where$u^{2} = {{\frac{c}{a}\left( {1 - r^{2}} \right)} = {{\frac{c}{a}\sin^{2}\phi} \geq 0.}}$Substituting p=q/u followed by θ=tan⁻¹p yields:${P\left( w \middle| z \right)} \propto {{P(w)}a^{{- N}/2}{\int_{- \frac{b}{a}}^{\infty}{\frac{1}{\left( {q^{2} + u^{2}} \right)^{N/2}}\quad{\mathbb{d}q}}}}$$\begin{matrix}{= {{P(w)}a^{{- N}/2}u^{1 - N}{\int_{- \frac{b}{au}}^{\infty}{\frac{1}{\left( {p^{2} + 1} \right)^{N/2}}\quad{\mathbb{d}p}}}}} \\{= {{P(w)}a^{{- N}/2}u^{1 - N}{\int_{{- \tan^{- 1}}\frac{b}{au}}^{\pi/2}{\cos^{N - 2}\quad\theta{\mathbb{d}\theta}}}}}\end{matrix}$

Substituting the appropriate expression for u:${{P\left( w \middle| z \right)} \propto {{P(w)}a^{{- N}/2}u^{\quad{1 - N}}{\int_{{- \tan^{- 1}}\frac{b}{au}}^{\pi/2}{\cos^{N - 2}\theta{\mathbb{d}\theta}}}}} = {{{P(w)}a^{{- 1}/2}{c^{- \frac{N - 1}{2}}\left( {1 - r^{2}} \right)}^{- \frac{N - 1}{2}}{\int_{{- \tan^{- 1}}\frac{r}{\quad\sqrt{1 - r^{2}}}}^{\pi/2}{\cos^{\quad{N - 2}}\theta{\mathbb{d}\theta}}}} = {{P(w)a^{{- 1}/2}c^{- \frac{N - 1}{2}}\sin^{- {({N - 1})}}\phi{\int_{\phi - {\pi/2}}^{\pi/2}{\cos^{N - 2}\quad\theta{\mathbb{d}\theta}}}} = {{P(w)}a^{{- 1}/2}c^{- \frac{N - 1}{2}}\sin^{- {({N - 1})}}\phi{\int_{{- \pi}/2}^{{\pi/2} - \phi}{\cos^{N - 2}\theta{\mathbb{d}\theta}}}}}}$

But c depends only on z, and so the following expression for P(w|z) isobtained:P(w|z) ∝ P(w)a^(−1/2)sin^(−(N − 1))ϕ∫_(−π/2)^(π/2 − ϕ)cos^(N − 2)θ  𝕕θ.

In order to determine P(w|z) for a range of w, a,b,c are calculated asabove (a and b being calculated for each w, but since a does not dependon z all the necessary values of a can be calculated once and for allwhen the first rod location is calculated), and hence φ is can beobtained for each w. All that then remains is to look up the value of∫_(−π/2)^(π/2 − ϕ)cos^(N − 2)θ  𝕕θin a table, as will now be described.

The integral ∫_(−π/2)^(π/2 − ϕ)cos^(N − 2)  θ𝕕θcan be evaluated iteratively, as follows:

Let Q_(n)(φ) denote$\int_{{- \pi}/2}^{\frac{\pi}{2} - \phi}{\cos^{n}\theta\quad{{\mathbb{d}\theta}.}}$Then for n>1 $\begin{matrix}{{Q_{n}(\phi)} = {\int_{{- \pi}/2}^{\frac{\pi}{2} - \phi}{\cos^{n}\theta{\mathbb{d}\theta}}}} \\{= {\int_{{- \pi}/2}^{\frac{\pi}{2} - \phi}{\cos^{2}\theta\quad\cos^{n - 2}\theta{\mathbb{d}\theta}}}} \\{= {\int_{{- \pi}/2}^{\frac{\pi}{2} - \phi}{\left( {1 - {\sin^{2}\theta}} \right)\cos^{n - 2}\theta{\mathbb{d}\theta}}}} \\{= {{Q_{n - 2}(\phi)} - {\int_{{- \pi}/2}^{\frac{\pi}{2} - \phi}{\sin^{2}\theta\quad\cos^{n - 2}\theta{\mathbb{d}\theta}}}}} \\{= {{Q_{n - 2}(\phi)} - {\int_{{- \pi}/2}^{\frac{\pi}{2} - \phi}{\left( {\sin\quad\theta} \right)\left( {\sin\quad\theta\quad\cos^{n - 2}\theta} \right){\mathbb{d}\theta}}}}}\end{matrix}$

Integrating by parts, whereby the second factor is integrated and thefirst is differentiated yields: ${\begin{matrix}{{Q_{n}(\phi)} = {{Q_{n - 2}(\phi)} - {\int_{{- \pi}/2}^{\frac{\pi}{2} - \phi}{\left( {\sin\quad\theta} \right)\left( {\sin\quad\theta\quad\cos^{n - 2}\theta} \right){\mathbb{d}\theta}}}}} \\{= {{Q_{n - 2}(\phi)} + {\frac{1}{n - 1}\left\lbrack {\left( {\sin\quad\theta} \right)\left( {\cos^{n - 1}\theta} \right)} \right\rbrack}_{{- \pi}/2}^{\frac{\pi}{2} - \phi} -}} \\{\frac{1}{n - 1}{\int_{{- \pi}/2}^{\frac{\pi}{2} - \phi}{\left( {\cos\quad\theta} \right)\left( {\cos^{n - 1}\theta} \right){\mathbb{d}\theta}}}} \\{= {{Q_{n - 2}(\phi)} + {\frac{1}{n - 1}\cos\quad\phi\quad\sin^{n - 1}\phi} - {\frac{1}{n - 1}{Q_{n}(\phi)}}}}\end{matrix}\therefore{\frac{n}{n - 1}{Q_{n}(\phi)}}} = {{{{Q_{n - 2}(\phi)} + {\frac{1}{n - 1}\cos\quad\phi\quad\sin^{n - 1}\phi}}\therefore{Q_{n}(\phi)}} = {{\frac{n - 1}{n}{Q_{n - 2}(\phi)}} + {\frac{1}{n}\cos\quad\phi\quad\sin^{n - 1}\phi}}}$

But Q₁(φ)=1+cos φ, and Q₀(φ)=π−φ, and thus a recurrence relation can beused to populate the table starting from n=1 and n=0.

The table starts from a value of r²=cos²φ and the sign of φ, and thevalues of log Q_(N-2)(φ) can be looked up. Accordingly, rather thanpopulate the table based on the values of φ (for example on a regulargrid), the table is populated on a regular grid of log(cos²φ), keepingtwo subtables of log Q_(N-2)(φ), one for values of positive values ofcos φ, and one for negative. Accordingly, log Q_(N-2)(φ) can berepresented accurately around values of φ near π/2, when Q_(N-2)(φ) ischanging very fast.

Thus, once the posterior distribution on w given z, i.e.; P(w|z), isobtained, a likely w having a higher probability value than other w'scan be obtained. As noted above, w is related to x, so once a likely wis identified, so is a likely x. Since each x is a subset of markings 12corresponding to a unique position of rod 10, the most probable xidentifies a particular location which is the most likely position ofrod 10, and a suitable (Bayesian) confidence interval on the position ofrod 10 is obtained.

Processor 18 can be configured to store previous rod positions in memory19, so that likely values of (i.e., confidence intervals on) velocity,acceleration, and jerk can be obtained. That information, in turn, canbe used to set a “prior” on w for the next position measurement, tothereby limit the range of w's for which P(w|z) is calculated.

At the outset, however, rod 10 can be located in any position, as wellas any velocity and acceleration within the limits of system 100. Thus,P(w|z) is calculated for each possible w (and thus for each possible rodposition). Since each w has a corresponding rod position, P(w|z) must becalculated for each such rod position. For a rod that is several meterslong, millions of such calculations are performed by processor 18. Afterthe first measurement, however, the number of possible rod locations islimited to those nearer the initial measurement, and the P(w|z)calculations take less time for subsequent measurements. Moreover, thesubsequent measurements can be used to calculate velocity andacceleration, as noted previously, which can be used to further limitthe number of possible w's over which P(w|z) is calculated. If theconfidence intervals are fairly narrow because the sensed signal tonoise ratios are relatively high, successive calculations will take lesstime because predictions can be made as to which positions are likelyand which are not based on previous determinations.

Alternatively, if the rod were to be set at the outset to a particularposition or a range of possible positions at each end of the linear path(if for example in FIG. 2, rod 10 were at the outset always retractedwithin cylinder body 220 so that marking endpoint 250 would be adjacentto reader circuit 26), the initial P(w|z) need only be made over alimited range of rod positions. In addition, as discussed above, furtherrod positions can be readily determined based on previous calculations.

Consistent with a further aspect of the disclosure, a method isdescribed for calculating the initial location of rod 10 more quickly.In the alternative method (see FIG. 16), typically performed byprocessor 18, a portion of rod surface 11 is exposed (step 1610) and asense signal is generated in response to light reflected from rod 10(step 1620) in a manner similar to that described above. If a positionof rod 10 has been previously determined, a set of rod positions can beassumed to be “Possible” within an acceptable distance about the lastmeasured location (step 1622). For example, if rod 10 is in a fullyextended position, the next immediate location will not likely be one inwhich the rod is fully retracted into cylinder 230. Accordingly,locations associated with the retracted position may not be deemed“Possible”, while others closer to the fully extended position will beconsidered “Possible.” Alternatively, if in a start-up mode, step 1622may be omitted.

In step 1624, processor 18 sets a data acceptance filter (data filteringinstructions carried out by processor 18) to its most rejecting settingto thereby subject higher or first frequency components of the sensedsignal to a first or relatively high deemphasis. In particular,processor 18, in accordance with the data acceptance filtering softwareor code, obtains data based on low or second frequency components of thesensed signal, which are less likely to change over a given portion ofrod surface 11, and are thus indicative of the probability values over aparticular region of surface 11. Accordingly, although the rod locationmight not be identified at this stage, one or more relatively broadregions (albeit not contiguous regions) of rod surface 11 may beidentified as likely areas in which the rod location is likely to befound.

In step 1626, a first spatial increment or distance is typically set toits largest value, for example, sixteen times the rod pixel width. In astart-up mode, probability values are determined corresponding to rodlocations separated from each other by the spatial increment along theentire length of the rod. If a set of Possible positions is availableafter step 1622, probability values P(w|z) are calculated at allPossible positions, except those within the increment of each other,i.e., between adjacent increment locations (step 1630). Otherwise, inthe start-up mode, probability values are calculated at each incrementlocation along the entire length of the rod.

A determination is made as to whether the acceptance filter is set to an“all-pass” value in which all signal frequency components are consideredand the increment has been reduced to the rod pixel width (step 1640).If so, processing continues with step 810 as previously described.Otherwise, one or more sets or groupings of calculated probabilityvalues is then determined (step 1660), the sum of each set exceeding acurrent predetermined threshold (to be discussed below). Those positionswhose probability values do not contribute to exceeding the currentpredetermined threshold are deemed “Not Possible”, as well as thosepositions between any two such “Not Possible” positions separated by anincrement. All “Not Possible” positions are not considered further (step1670).

Thus, after step 1670, in the first iteration of the process shown inFIG. 16, set of probability values defining regions in surface 11 areobtained where the rod location is likely to be found. In addition, allother locations lying outside these regions, which may or may not becontiguous, are not considered further. In the next iteration, the dataacceptance filter software is set to a more accepting setting (step1680), whereby the frequency components of the sensed signal are subjectto a second deemphasis less than the first (step 1624). Thus, higherfrequency components of the sensed signal are considered by processor18, and data based on such frequency components is obtained, in additionto data obtained from lower frequency components, as discussed above.Also, probability values are determined at smaller spatial increments(i.e., second distances less than the first distances) within theseregions (step 1690), and the current predetermined threshold is reduced(step 1695).

The rationale for including step 1695 will now be explained. At eachiteration round the loop in FIG. 16 (steps 1630, 1640, 1660, 1670, 1680,1690 and 1695), some additional locations are identified as “NotPossible”. It is desired that the total probability associated with thetotality of these locations so identified not exceed (one minus thepredetermined threshold). A number of possible approaches to achievingthis are conceivable.

Let us call the predetermined threshold p₀. If it is known that (say) 5iterations round the loop will be done, then one approach is, instead ofusing p₀ as the acceptance threshold each time, to use$1 - {\frac{\left( {1 - p_{0}} \right)}{5}.}$The total probability discarded in the five iterations is then at most$\frac{1 - p_{0}}{5} + {\left( {1 - \frac{1 - p_{0}}{5}} \right)\left( \frac{1 - p_{0}}{5} \right)} + {\left( {1 - \frac{1 - p_{0}}{5}} \right)^{2}\left( \frac{1 - p_{0}}{5} \right)} + \ldots + {\left( {1 - \frac{1 - p_{0}}{5}} \right)^{4}\left( \frac{1 - p_{0}}{5} \right)}$

which cannot exceed 1−p₀, so what remains (in the final triplet, if asatisfactory one exists) must have probability at least p₀.

Generally, however, if a threshold p_(k) is used at the k th iterationwith a total of K iterations, in such a way that the part of the rodpassed on to the next iteration as still “Possible” has a probability ofat least p_(k) given that the true location was already being consideredto be “Possible”, then the total discarded probability will not exceed$\sum\limits_{k = 1}^{K}\left( {\left( {\sum\limits_{k^{\prime} = 1}^{k - 1}p_{k^{\prime}}} \right)\left( {1 - p_{k}} \right)} \right)$

so any sequence of thresholds p_(k) such that${\sum\limits_{k = 1}^{K}\left( {\left( {\sum\limits_{k^{\prime} = 1}^{k - 1}p_{k^{\prime}}} \right)\left( {1 - p_{k}} \right)} \right)} \leq {1 - p_{0}}$

will achieve the desired effect. The precise choice of this sequence ofthresholds will vary from situation to situation, but is made to ensurethat as many of the possible rod locations are rejected as early in theprocessing as possible.

In other words, once a sum of probability values is determined to exceedthe current predetermined threshold, the actual rod location can be saidto lie within the areas of the rod as defined by the rod locationsassociated with the summed probability values. Accordingly, for example,if the current predetermined threshold is 0.99, the rod location may besaid to be within particular regions on the surface 11 with a 0.99probability. However, there is a probability of 0.01 that the rodlocation lies outside these regions. If steps 1630 to 1680 are repeatedwith a reduced increment, then more narrow regions on surface 11 will beidentified as likely to include the rod location, but also there will beadditional areas that will not be considered further. Thus, theprobability that the rod location lies in one of these non-consideredareas increases because the number of these areas increases with eachiteration. Thus, step 1695 is provided to adjust the currentpredetermined threshold according to the adopted sequence of valuesp_(k), from p_(k) to p_(k+1).

After reducing the increment (step 1690), for example, the next smallestincrement may be 8 rod pixel widths, and adjusting the currentpredetermined threshold (step 1695), step 1630 is repeated over thenarrower regions discussed above and at smaller increments so that asmaller number of probability values is then calculated followed byremaining steps shown in FIG. 16. This smaller set corresponds to asmaller set of possible rod locations within the range of possible rodlocations calculated above, and a group of possible marking subsetsbased upon the further set of probability values is identified. Steps1630, 1640, 1660, 1670, 1680, 1690 and 1695 are repeated until allfrequency components of the sensed signal are considered, and theincrement is set to the narrowest desired value, in this example, thepixel width. At which point, processor 18 performs step 810 (see FIG. 8)and the sum of remaining probability values after the repeatediterations is obtained and a determination is made as to whether the sumexceeds the desired predetermined probability threshold (now the reducedcurrent predetermined threshold). If so, a corresponding marking subsetis obtained (step 812), which is then associated with a rod location(step 814), as discussed above. If not, a bad reading is reported and noinformation is available to restrict the range for the next readingbeyond what may already be inferable from preceding measurements, ifany.

The method shown in FIG. 16, can be expressed mathematically, asfollows. For clarity, the situation is simplified here by assuming V=I,U=0; more complicated real conditions can be incorporated in aconventional manner given the previously shown calculations. Thus,$B = {\left( {AA}^{\prime} \right)^{- \frac{1}{2}}.}$

cos φ may be written as $\begin{matrix}{{\cos\quad\phi_{x}} = \frac{x^{\prime}A^{\prime}B^{\prime}{By}}{\sqrt{\left( {x^{\prime}A^{\prime}B^{\prime}{BAx}} \right)\left( {y^{\prime}B^{\prime}{By}} \right)}}} \\{= \frac{\left( {A^{\prime}B^{\prime}{BAx}} \right)^{\prime}\left( {A^{\prime}B^{\prime}{By}} \right)}{\sqrt{\left( {\left( {A^{\prime}B^{\prime}{BAx}} \right)^{\prime}\left( {A^{\prime}B^{\prime}{BAx}} \right)} \right)\left( {\left( {A^{\prime}B^{\prime}{By}} \right)^{\prime}\left( {A^{\prime}B^{\prime}{By}} \right)} \right)}}} \\{= \frac{w_{x}^{\prime}z}{\sqrt{\left( {w_{x}^{\prime}w_{x}} \right)\left( {z^{\prime}z} \right)}}}\end{matrix}$

where w_(x) denotes the w vector corresponding to position x on the rod.Note that it is not feasible to store all the w_(x), however, it ispossible to store all the w_(x)′w_(x) values.

Now let matrix G represent a low-pass filtering matrix operating onR^(N) and yielding results in R^(M) for some M<N, and with the propertythat GG′ is an identity matrix on R^(M) (e.g. the matrix that firstapplies a top-hat filter and then downsamples by the correspondingfactor). For each x, instead of calculating the value of cos φ_(x) bythe previous method based on all the data (i.e. on z), x is calculatedinstead based on only part of the data, specifically on Gz. Gw_(x) isfirst precalculated for each xεX, and likewise Gz is precalculated.Then, given only this limited information, P(w|z) is given by the sameexpression as before, but the expression for cos φ_(x) is replaced by${\cos\quad\phi_{x}} = {\frac{w_{x}^{\prime}G^{\prime}{Gz}}{\sqrt{\left( {w_{x}^{\prime}G^{\prime}{Gw}_{x}} \right)\left( {z^{\prime}G^{\prime}{Gz}} \right)}}.}$

Since M<N, this expression costs correspondingly less to evaluate (givenGw_(x) and Gz already available). Moreover, since G is a low-passfilter, it is reasonable to suppose that adjacent values of cos φ_(x)will be almost identical—simplifying calculations further. With thisapproach, however, Gw_(x) would need to be stored (or, worse, evaluatedfor each xεX), which is not feasible.

However, if the additional assumption is made thatG′GA′(AA′)⁻¹AG′G≅G′GA′(AA′)⁻¹A, which is true within around 6% for theparticular G being considered, then the above expression simplifies to${\cos\quad\phi_{x}} \approx \frac{{xG}^{\prime}{Gz}}{\sqrt{\left( {w_{x}^{\prime}G^{\prime}{Gw}_{x}} \right)\left( {z^{\prime}G^{\prime}{Gz}} \right)}}$

which is evaluable using only the stored values of the xεX and thestored values of w_(x)′G′Gw_(x) (which are easier to store). Note thatthis approximation does not mean that w_(x)′G′Gw_(x)≅x′G′Gx, and indeedthis is not the case.

Now, assuming a value δ>0 such that it is acceptable to draw a wrongconclusion with probability at most δ>0, and also a value a such that0<α<1 (e.g. ⅔), the following algorithm can be used to accelerateidentification of the initial location of rod 10. G is set to thenarrowest-bandwidth low-pass filter being considered and also set$\gamma = {\frac{\alpha\delta}{1 - \alpha}.}$P(w|z) is then evaluated using only the G-restricted information forsuitably spaced. xεX (dependent on the particular G) (if G is theidentity use the precise formula and full resolution among the remainingxεX) to remove from further consideration as many xεX as possibleconsistent with their total posterior probability being at most γ. If Gwas not the identity, set G to be the next broader low-pass filter, andγ:=αγ is updated. Then P(w|z) is evaluated, including at higherresolution those xεX not removed, as well as xεX that are near thosethat were not removed, and the process is repeated for the new subsetand the new G. The process terminates at the end of the iteration inwhich G is the identity; and terminates in the same manner as thesimpler version of the process described in FIG. 8.

INDUSTRIAL APPLICABILITY

A barcode reader and processing circuitry are disclosed for identifyinga position of a cylinder rod that moves along a linear path. The barcodeconstitutes a series of markings on an outer surface of the rodextending along a substantial portion of the length of the rod. Themarkings represent encoded information based on numbers calculated witha random number generator, and are grouped into subsets, each of whichcorresponds to a particular rod position. A portion of the rod includinga subset of barcode markings is exposed to light emitted from LEDs inthe reader. Light reflected off the barcode is sensed with an array ofphotosensors provided in the reader. The photosensors generateelectrical signals, and using Bayesian probability, a likely subset ofmarkings is determined corresponding to the received electrical signals.Once identified, the, markings subset is associated with a locationcorresponding to the position of the rod.

Although the disclosed embodiments have been described in connectionwith a rod used in a hydraulic or pneumatic cylinder, the presentdisclosure can be used to identify the location of other actuatedmovable members. For example, the disclosure can be used in connectionwith robotic applications.

As noted above with respect to FIG. 1, the identified rod location canbe reported visually to a user on a display in user interface 22. Inresponse to the identified rod location, a user may input commands tocontrol the rod 10. Based on such instructions, processor 18 may providecontrol signals to mechanical control 20 to actuate rod 10 and a worktool attached thereto in a desired manner.

Alternatively, a user may supply instructions through user interface 22to processor 18 including parameters for a particular job to beperformed by system 100. Once inputted, system 100 can appropriatelycontrol rod 10 until the job is completed. For example, if a ditch is tobe dug having particular dimensions, such parameters may be inputthrough user interface 22 to processor 18. Throughout the job, processor18 can monitor the location of rod 10, and thus, assure that system 100stays within the parameters defined by the user. For example, if theditch is to be dug to a specified depth, system 100 can monitor how deepa work tool has dug by identifying the position of rod 10, and can thusdiscontinue further digging once the desired depth has been achieved.Other embodiments of the invention will be apparent to those skilled inthe art from consideration of the specification and practice of theinvention disclosed herein. It is intended that the specification andexamples be considered as exemplary only, with a true scope of theinvention being indicated by the following claims.

1-47. (canceled)
 48. An apparatus for reading an image provided on asurface, said apparatus comprising: a plurality of photosensors; a lens,said lens being configured to receive light from said image and directsaid light to said plurality of photosensors; a carrier, said lens andsaid plurality of photosensors being attached to said carrier; and ahousing, said housing having an external surface and an internalsurface, said external surface having a first reference portion and saidinternal surface having a second reference portion, said secondreference portion being aligned with said first reference portion, saidcarrier being attached to said second reference portion such that uponsaid first reference portion being positioned at a predetermineddistance away from said image, said light is substantially focused ontosaid plurality of photosensors.
 49. An optical device in accordance withclaim 48, wherein said housing has an opening, said light passingthrough said opening, said optical device further including at least oneoptical emitter provided in said housing, each of which being configuredto direct light through said opening to said image.
 50. An opticaldevice in accordance with claim 49, wherein said surface issubstantially uniformly exposed by said light.
 51. An optical device inaccordance with claim 49, further comprising a cylindrical lens providedbetween said at least one optical emitter and said image.
 52. An opticaldevice in accordance with claim 48, wherein a first point on said firstreference portion and a second point on said second reference portiondefine a reference line located between said plurality of photosensorsand said lens such that as said housing thermally expands said pluralityof photosensors moves in a direction opposite to the direction in whichsaid lens moves, and said light remains substantially focused onto saidplurality of photosensors.
 53. An optical device in accordance withclaim 48, further including a casing provided between said firstreference portion and said second reference portion, said casing havinga thickness, said thickness corresponding to said predetermineddistance.
 54. An optical device in accordance with claim 48, whereinsaid image is a barcode.
 55. An optical device in accordance with claim49, wherein said at least one optical emitter includes an LED.
 56. Anoptical device comprising: a housing having an opening; first and secondoptical emitters provided in said housing, said first and second opticalemitters being configured to output light through said opening; acircuit configured to supply substantially the same electrical currentto said first and second optical emitters; and a plurality ofphotosensors provided in said housing, said plurality of photosensorsreceiving a portion of said light reflected off a surface external tosaid housing.
 57. An optical device in accordance with claim 56, whereinsaid circuit includes first and second transistors, the emitter of saidfirst transistor and the emitter of said second transistor being coupledto a common terminal via respective resistors, said common terminalbeing maintained at a predetermined potential, and a collector of saidfirst transistor being coupled to said first optical emitter and acollector of said second transistor being coupled to said second opticalemitter, and the bases of said first and second transistors beingconnected together.
 58. An optical device in accordance with claim 57,wherein said circuit further includes a diode coupled between saidcollector of said first transistor and the base of said firsttransistor.
 59. An optical device in accordance with claim 57, whereinfirst and second optical emitters include first and second electrodes,respectively, said first and second electrodes being connected incommon, said optical device further including a power supply beingcoupled to said commonly connected first and second electrodes, saidpower supply being configured to intermittently bias said first andsecond electrodes to thereby pass said electrical current through saidfirst and second optical emitters.
 60. An optical device in accordancewith claim 59, wherein said first and second optical emitters are LEDs.61. An optical device in accordance with claim 58, further comprising aresistor coupled between said base and said collector of said secondtransistor.
 62. An optical device in accordance with claim 58, whereinsaid diode includes a Schottky diode.
 63. An optical device inaccordance with claim 56, further comprising a plurality of lensesprovided between said plurality of optical emitters and said image, saidplurality of lenses including a selfoc lens array.
 64. An optical devicein accordance with claim 56, wherein said optical emitters and saidplurality of photosensors are formed integrally with said carrier.65-76. (canceled)